package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.PubNavigationMapper;
import com.ruoyi.system.domain.PubNavigation;
import com.ruoyi.system.service.IPubNavigationService;

/**
 * 导航Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-10
 */
@Service
public class PubNavigationServiceImpl implements IPubNavigationService 
{
    @Autowired
    private PubNavigationMapper pubNavigationMapper;

    /**
     * 查询导航
     * 
     * @param id 导航主键
     * @return 导航
     */
    @Override
    public PubNavigation selectPubNavigationById(Long id)
    {
        return pubNavigationMapper.selectPubNavigationById(id);
    }

    /**
     * 查询导航列表
     * 
     * @param pubNavigation 导航
     * @return 导航
     */
    @Override
    public List<PubNavigation> selectPubNavigationList(PubNavigation pubNavigation)
    {
        return pubNavigationMapper.selectPubNavigationList(pubNavigation);
    }

    /**
     * 新增导航
     * 
     * @param pubNavigation 导航
     * @return 结果
     */
    @Override
    public int insertPubNavigation(PubNavigation pubNavigation)
    {
        pubNavigation.setCreateTime(DateUtils.getNowDate());
        return pubNavigationMapper.insertPubNavigation(pubNavigation);
    }

    /**
     * 修改导航
     * 
     * @param pubNavigation 导航
     * @return 结果
     */
    @Override
    public int updatePubNavigation(PubNavigation pubNavigation)
    {
        pubNavigation.setUpdateTime(DateUtils.getNowDate());
        return pubNavigationMapper.updatePubNavigation(pubNavigation);
    }

    /**
     * 批量删除导航
     * 
     * @param ids 需要删除的导航主键
     * @return 结果
     */
    @Override
    public int deletePubNavigationByIds(Long[] ids)
    {
        return pubNavigationMapper.deletePubNavigationByIds(ids);
    }

    /**
     * 删除导航信息
     * 
     * @param id 导航主键
     * @return 结果
     */
    @Override
    public int deletePubNavigationById(Long id)
    {
        return pubNavigationMapper.deletePubNavigationById(id);
    }
}
